import * as actionTypes from '../action_types';

const initState = {
    attributeList:[],
    attributeListAll:[],
    contentList:[],
    relationList:[],
    curriculumList:[]
};
const Reducer = (state = initState, action) => {
    const { type, data} = action
    let newState = JSON.parse(JSON.stringify(state));
    switch (type) {
        case actionTypes.SAVE_ATTRIBUTE_LIST:
            newState.attributeList =data;         
            return newState;
        case actionTypes.SAVE_CONTENT_LIST:
            newState.contentList = data;
            return newState;
        case actionTypes.SAVE_ATTRIBUTE_LIST_ALL:
            newState.attributeListAll = data;
            return newState; 
        case actionTypes.SAVE_RELATION_LIST:
            newState.relationList = data;
            return newState;
            case actionTypes.SAVE_CURRICULUM_LIST:
                newState.curriculumList = data;
                return newState;  
        default:
            return state;
    }

}
export default Reducer;
